package com.lightsaber.trade.as.entity.device;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.lightsaber.trade.core.entity.BaseEntity;

@Entity
@Table(name = "MONI_DEVICE")
public class Device extends BaseEntity {

    private static final long serialVersionUID = -5933831841972083402L;

    @Column(name = "SERIAL_NUMBER", length = 32)
    private String serialNumber;

    @Column(name = "NAME", length = 20)
    private String name;

    @Column(name = "ADDRESS", length = 200)
    private String address;

    @Column(name = "STATUS", length = 20)
    private String status;

    @OneToMany(mappedBy = "device", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<CommandPublishToDevice> commandPublishToDeviceList;

    @OneToMany(mappedBy = "device", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private List<InfoCollectForDevice> infoCollectForDeviceList;

    public String getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public List<CommandPublishToDevice> getCommandPublishToDeviceList() {
        return commandPublishToDeviceList;
    }

    public void setCommandPublishToDeviceList(
            List<CommandPublishToDevice> commandPublishToDeviceList) {
        this.commandPublishToDeviceList = commandPublishToDeviceList;
    }

    public List<InfoCollectForDevice> getInfoCollectForDeviceList() {
        return infoCollectForDeviceList;
    }

    public void setInfoCollectForDeviceList(List<InfoCollectForDevice> infoCollectForDeviceList) {
        this.infoCollectForDeviceList = infoCollectForDeviceList;
    }

}
